<template>
  <div class="sidebar-logo-container" :class="{ collapse: leftCollapse }">
    <div v-if="leftCollapse" class="sidebar-logo-link">
      <img v-if="logo" :src="logoicon" style="width:23px;height:23px" />
      <h1 v-else class="sidebar-title">{{ title }}</h1>
    </div>
    <div v-else class="sidebar-logo-link">
      <!-- <img v-if="logo" :src="logo" class="sidebar-logo" >
      <h1 class="sidebar-title">{{ title }}</h1> -->
      <img v-if="smc" :src="logoicon" style="width:23px;height:23px" />
      <h1 class="sidebar-title">{{ title }}</h1>
    </div>
  </div>
</template>

<script>
import logoImg from '@/assets/logo.png'
import lcfc from '@/assets/lcfc.jpg'
import smc from '@/assets/smc.png'
import sc from '@/assets/sc.png'
import logo from '@/assets/logo-icon.png'

export default {
  name: 'Logo',
  data() {
    return {
      title: this.$t('Login.systemName'),
      logo: logoImg,
      lcfc: lcfc,
      smc: smc,
      logoicon: logo,
      sc: sc
    }
  },
  computed: {
    leftCollapse() {
      return this.$store.getters['style/getLeftCollapse']
    }
  }
}
</script>

<style lang="scss">
.sidebar-logo-container {
  position: relative;
  width: 100%;
  height: 40px;
  line-height: 40px;
  background: rgb(13, 53, 108);
  text-align: center;
  overflow: hidden;

  .sidebar-logo-link {
    height: 100%;
    width: 100%;
    background-color: rgb(13, 53, 108);
    display: flex;
    justify-content: left;
    padding-left: 20px;
    align-items: center;
    margin-top: 5px;

    .sidebar-logo {
      width: 32px;
      height: 32px;
      vertical-align: middle;
      margin-right: 12px;
    }

    .sidebar-title {
      display: inline-block;
      margin: 0;
      color: #fff;
      font-weight: 600;
      line-height: 50px;
      font-size: 26px;
      font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
      vertical-align: middle;
      margin-left: 10px;
    }
  }

  &.collapse {
    .sidebar-logo {
      margin-right: 0px;
    }
  }
}
</style>
